/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package olap4cloud.data;

public class DataStruct {
	
	private long timestamp;
	private int userId;
	private String domain;
	private String url;
	private int channelId;
	private long ip;
	private String browser;
	private int country;
	
	public DataStruct(String data){
		String[] split = data.split("\t");
		//1364144461108	1583675755	usatoday.com	dancing-stars-ladies-lead-week-2-025416292.html	3	3467668715"
		timestamp = Long.parseLong(split[0]);
		userId = Integer.parseInt(split[1]);
		domain = split[2];
		url = split[3];
		channelId = Integer.parseInt(split[4]);
		ip = Long.parseLong(split[5]);
		browser = split[6];
		country = Integer.parseInt(split[7]);
	}
		
	public DataStruct(long timestamp, int userId, String domain, String url,
			int channelId, long ip, String browser, int country) {
		super();
		this.timestamp = timestamp;
		this.userId = userId;
		this.domain = domain;
		this.url = url;
		this.channelId = channelId;
		this.ip = ip;
		this.browser = browser;
		this.country = country;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public String getDomain() {
		return domain;
	}

	public void setDomain(String domain) {
		this.domain = domain;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public int getChannelId() {
		return channelId;
	}

	public void setChannelId(int channelId) {
		this.channelId = channelId;
	}

	public long getIp() {
		return ip;
	}

	public void setIp(long ip) {
		this.ip = ip;
	}

	public String getBrowser() {
		return browser;
	}

	public void setBrowser(String browser) {
		this.browser = browser;
	}
	
	public int getCountry() {
		return country;
	}

	public void setCountry(int country) {
		this.country = country;
	}

	@Override
	public String toString() {
		return "DataStruct [timestamp=" + timestamp + ", userId=" + userId
				+ ", domain=" + domain + ", url=" + url + ", channelId="
				+ channelId + ", ip=" + ip + ", browser=" + browser + "]";
	}
	
	
}
